package com.ewili.x.special.controller.strategy;

import com.ewili.framework.param.Response;
import com.ewili.x.special.service.strategy.inter.StrategyService;
import com.ewili.x.special.vo.ExecsVo;
import com.ewili.x.special.vo.NewStockStrategyResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/strategy")
public class StrategyController {

    @Autowired
    private StrategyService strategyService;

    @RequestMapping("/doStrategy")
    @ResponseBody
    public Response doStrategy() {
        //List<StrategyVo> strategyVos = strategyService.newStockDownStrategy();
        //NewStockStrategyResponse response = new NewStockStrategyResponse();
        //response.setStrategyVos(strategyVos);

        //List<ValueVo> valueVos = strategyService.findValues();
        List<ExecsVo> execsVos = strategyService.findWholdExecs();
        NewStockStrategyResponse response = new NewStockStrategyResponse();
        response.setKlineVos(execsVos);
        return response;
    }

    @RequestMapping("/getvalue")
    public String getvalue() {
        return "admin/chart";
    }
}
